//
//  SHYSecondViewController.m
//  SHYRouter
//
//  Created by sunhaiyan on 16/6/20.
//  Copyright © 2016年 [sunhaiyan]. All rights reserved.
//

#import "SHYSecondViewController.h"
#import "UIViewController+SchemaNode.h"

@implementation SHYSecondViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor redColor];
    // Do any additional setup after loading the view, typically from a nib.
    
    self.title = @"shy second";
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(100, 100, 200, 30);
    button.backgroundColor = [UIColor colorWithWhite:0.7 alpha:1];
    [button addTarget:self action:@selector(pushView) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    
    NSLog(@"%@",self.additionalDataDict);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)pushView {
    //    NSURL *url = [[SHYSchemaManager defaultManager] schemaUrlForTabName:SHYSchemaRouterNodeHeaderTab1 moduleName:SHYSchemaRouterNodeHeaderModule1 paramDict:nil];
    
    NSURL *url = [self schemaUrlForTabName:SHYSchemaRouterNodeHeaderTab1 moduleName:SHYSchemaRouterNodeHeaderModule1 paramDict:@{@"key": @"value111"}];
    
    [[SHYRouter sharedInstance] pushToUrl:url];
    
}

+ (void)load {
    [self registerWithTabName:SHYSchemaRouterNodeHeaderTab1 moduleName:@"shysecond" class:self.class];
    [self registerWithTabName:SHYSchemaRouterNodeHeaderTab2 moduleName:@"shysecond" class:self.class];
}

@end
